<?php

Loader::loadClass('InnoUtil', "modules/HotelBooking/pnincludes");
Loader::loadClass('SpaUtil', "modules/HotelBooking/pnincludes");

function HotelBooking_pntables()
{
    // Initialise table array
    $pntable = array();
    $pntable = createFirstGroupTable();

    return $pntable;
}

function &createFirstGroupTable()
{
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelMember
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelmember'] = DBUtil::getLimitedTablename('hotelbooking_hotelmember');
    $pntable['hotelbooking_hotelmember_column'] = array(
                                        'id'           => 'hbm_id',
                                        'hotelName'    => 'hbm_hotelname',
                                        'description'  => 'hbm_description',
                                        'accommodation'=> 'hbm_accommodation',
                                        'facilities'   => 'hbm_facilities',
                                        'restaurant'   => 'hbm_restaurant',
                                        'contactus'    => 'hbm_contactus',
                                        'other'        => 'hbm_other',
                                        'latitude'     => 'hbm_latitude',
                                        'longitude'    => 'hbm_longitude'
    );
    $pntable['hotelbooking_hotelmember_column_def'] = array(                                        
                                        'id'      => 'INT(11) AUTOINCREMENT PRIMARY',   
                                        'hotelName'    => 'VARCHAR(255)',
                                        'description'  => 'TEXT',
                                        'accommodation'=> 'TEXT',
                                        'facilities'   => 'TEXT',
                                        'restaurant'   => 'TEXT',
                                        'contactus'    => 'TEXT',
                                        'other'        => 'TEXT',
                                        'latitude'     => 'VARCHAR(255)',
                                        'longitude'    => 'VARCHAR(255)'
    );
    $pntable['hotelbooking_hotelmember_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelmember_column'], 'hbm_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelmember_column_def']);

    ////////////////////////////////////////////
    //table definition HotelBooking_HotelNews
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelnews'] = DBUtil::getLimitedTablename('hotelbooking_hotelnews');
    $pntable['hotelbooking_hotelnews_column'] = array(
                                        'id'            => 'hbn_id',
                                        'title'         => 'hbn_title',
                                        'body'          => 'hbn_body',
                                        'hotelMember_id'=> 'hbn_hotelmember_id'             
    );
    $pntable['hotelbooking_hotelnews_column_def'] = array(                                        
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'title'         => 'VARCHAR(255)',
                                        'body'          => 'TEXT',
                                        'hotelMember_id'=> 'INT(11)'                         
    );
    $pntable['hotelbooking_hotelnews_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelnews_column'], 'hbn_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelnews_column_def']);
   
     ////////////////////////////////////////////
    //table definition HotelBooking_HotelRoom
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelroom'] = DBUtil::getLimitedTablename('hotelbooking_hotelroom');
    $pntable['hotelbooking_hotelroom_column'] = array(
                                        'id'            => 'hbr_id',
                                        'name'          => 'hbr_name',
                                        'description'   => 'hbr_description',
                                        'adult'         => 'hbr_adult',
                                        'child'         => 'hbr_child',
                                        'extrabed'      => 'hbr_extrabed',
                                        'sort'          => 'hbr_sort',
                                        'hotelMember_id'=> 'hbr_hotelmember_id'         
    );
    $pntable['hotelbooking_hotelroom_column_def'] = array(                                        
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'name'          => 'VARCHAR(255)',
                                        'description'   => 'VARCHAR(255)',
                                        'adult'         => 'INT(11)',
                                        'child'         => 'INT(11)',
                                        'extrabed'      => 'INT(11)',
                                        'sort'          => 'INT(11)',
                                        'hotelMember_id'=> 'INT(11)'          
    );
    $pntable['hotelbooking_hotelroom_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelroom_column'], 'hbr_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelroom_column_def']);
    
     ////////////////////////////////////////////
    //table definition HotelBooking_HotelSeason
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelseason'] = DBUtil::getLimitedTablename('hotelbooking_hotelseason');
    $pntable['hotelbooking_hotelseason_column'] = array(
                                        'id'            => 'hbs_id',
                                        'name'          => 'hbs_name',
                                        'description'   => 'hbs_description',
                                        'date_start'    => 'hbs_date_start',
                                        'date_end'      => 'hbs_date_end',
                                        'hotelMember_id'=> 'hbs_hotelmember_id'         
    );
    $pntable['hotelbooking_hotelseason_column_def'] = array(                                        
                                        'id'             => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'name'           => 'VARCHAR(255)',
                                        'description'    => 'VARCHAR(255)',
                                        'date_start'     => 'DATE NOTNULL',
                                        'date_end'       => 'DATE NOTNULL',
                                        'hotelMember_id' => 'INT(11)'          
    );
    $pntable['hotelbooking_hotelseason_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelseason_column'], 'hbs_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelseason_column_def']);
    
     ////////////////////////////////////////////
    //table definition HotelBooking_HotelRate
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelrate'] = DBUtil::getLimitedTablename('hotelbooking_hotelrate');
    $pntable['hotelbooking_hotelrate_column'] = array(
                                        'id'            => 'hbra_id',
                                        'room_rate'     => 'hbra_room_rate',
                                        'hotelRoom_id'  => 'hbra_hotelRoom_id',
                                        'season_id'     => 'hbra_season_id',            
                                        'hotelMember_id'=> 'hbra_hotelmember_id'        
    );
    $pntable['hotelbooking_hotelrate_column_def'] = array(                                        
                                        'id'              => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'room_rate'       => 'INT(11)',
                                        'hotelRoom_id'    => 'INT(11)',
                                        'season_id'       => 'INT(11)',
                                        'hotelMember_id'  => 'INT(11)'
    );
    $pntable['hotelbooking_hotelrate_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelrate_column'], 'hbra_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelrate_column_def']);
    
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelPromotion
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelpromotion'] = DBUtil::getLimitedTablename('hotelbooking_hotelpromotion');
    $pntable['hotelbooking_hotelpromotion_column'] = array(
                                        'id'            => 'hbp_id',
                                        'title'         => 'hbp_title',
                                        'description'   => 'hbp_description',
                                        'start'         => 'hbp_start',       
                                        'end'           => 'hbp_end', 
                                        'isActive'      => 'hbp_isactive',
                                        'hotelMember_id'=> 'hbp_hotelmember_id'
    );
    $pntable['hotelbooking_hotelpromotion_column_def'] = array(                                     
                                        'id'             => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'title'          => 'VARCHAR(255)',
                                        'description'    => 'VARCHAR(255)',
                                        'start'          => 'DATE NOTNULL',
                                        'end'            => 'DATE NOTNULL', 
                                        'isActive'       => 'INT(11)',          
                                        'hotelMember_id' => 'INT(11)'          
    );
    $pntable['hotelbooking_hotelpromotion_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelpromotion_column'], 'hbp_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelpromotion_column_def']);
    
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelBooking
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelbooking'] = DBUtil::getLimitedTablename('hotelbooking_hotelbooking');
    $pntable['hotelbooking_hotelbooking_column'] = array(
                                        'id'            => 'hbb_id',
                                        'firstName'     => 'hbb_firstname',
                                        'lastName'      => 'hbb_lastname',
                                        'gender'        => 'hbb_gender',       
                                        'email'         => 'hbb_email', 
                                        'telephone'     => 'hbb_telephone',
                                        'address'       => 'hbb_address',
                                        'city'          => 'hbb_city',
                                        'country'       => 'hbb_country',
                                        'postcode'      => 'hbb_postcode',
                                        'rate_id'       => 'hbb_rate_id',
                                        'hotelRoom_id'  => 'hbb_hotelroom_id',
                                        'hotelMember_id'=> 'hbb_hotelmember_id',
                                        'season_id'     => 'hbb_season_id'
    );
    $pntable['hotelbooking_hotelbooking_column_def'] = array(                                     
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY', 
                                        'firstName'     => 'VARCHAR(255)',
                                        'lastName'      => 'VARCHAR(255)',
                                        'gender'        => 'INT(1)',
                                        'email'         => 'VARCHAR(255)',
                                        'telephone'     => 'VARCHAR(255)',
                                        'address'       => 'VARCHAR(255)',
                                        'city'          => 'VARCHAR(255)',
                                        'country'       => 'VARCHAR(255)',
                                        'postcode'      => 'INT(11)',
                                        'rate_id'       => 'INT(11)',
                                        'hotelRoom_id'  => 'INT(11)',
                                        'hotelMember_id'=> 'INT(11)',
                                        'season_id'     => 'INT(11)'          
    );
    $pntable['hotelbooking_hotelbooking_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelbooking_column'], 'hbb_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelbooking_column_def']);
   
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelImages
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelimages'] = DBUtil::getLimitedTablename('hotelbooking_hotelimages');
    $pntable['hotelbooking_hotelimages_column'] = array(
                                        'id'            => 'hbi_id',
                                        'hotelMember_id'=> 'hbi_hotelMember_id',
                                        's_fileName'    => 'hbi_s_filename',
                                        'm_fileName'    => 'hbi_m_filename',       
                                        'l_fileName'    => 'hbi_l_filename', 
                                        's_path'        => 'hbi_s_path',
                                        'm_path'        => 'hbi_m_path',
                                        'l_path'        => 'hbi_l_path',
                                        's_url'         => 'hbi_s_url',
                                        'm_url'         => 'hbi_m_url',
                                        'l_url'         => 'hbi_l_url',
                                        'o_fileName'    => 'hbi_o_filename',
                                        'o_path'        => 'hbi_o_path',
                                        'o_url'         => 'hbi_o_url',
                                        'type'          => 'hbi_type'
    );
    $pntable['hotelbooking_hotelimages_column_def'] = array(                                     
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'hotelMember_id'=> 'INT(11)',
                                        's_fileName'    => 'VARCHAR(255)',
                                        'm_fileName'    => 'VARCHAR(255)',       
                                        'l_fileName'    => 'VARCHAR(255)', 
                                        's_path'        => 'VARCHAR(255)',
                                        'm_path'        => 'VARCHAR(255)',
                                        'l_path'        => 'VARCHAR(255)',
                                        's_url'         => 'VARCHAR(255)',
                                        'm_url'         => 'VARCHAR(255)',
                                        'l_url'         => 'VARCHAR(255)',
                                        'o_fileName'    => 'VARCHAR(255)',
                                        'o_path'        => 'VARCHAR(255)',
                                        'o_url'         => 'VARCHAR(255)',
                                        'type'          => 'VARCHAR(255)'
    );
    $pntable['hotelbooking_hotelimages_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelimages_column'], 'hbi_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelimages_column_def']);
    
    
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelRoomImages
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelroomimages'] = DBUtil::getLimitedTablename('hotelbooking_hotelroomimages');
    $pntable['hotelbooking_hotelroomimages_column'] = array(
                                        'id'            => 'hri_id',
                                        'hotelMember_id'=> 'hri_hotelMember_id',
                                        'hotelRoom_id'  => 'hri_hotelroom_id',
                                        's_fileName'    => 'hri_s_filename',
                                        'm_fileName'    => 'hri_m_filename',       
                                        'l_fileName'    => 'hri_l_filename', 
                                        's_path'        => 'hri_s_path',
                                        'm_path'        => 'hri_m_path',
                                        'l_path'        => 'hri_l_path',
                                        's_url'         => 'hri_s_url',
                                        'm_url'         => 'hri_m_url',
                                        'l_url'         => 'hri_l_url',
                                        'o_fileName'    => 'hri_o_filename',
                                        'o_path'        => 'hri_o_path',
                                        'o_url'         => 'hri_o_url',
                                        'type'          => 'hri_type'
    );
    $pntable['hotelbooking_hotelroomimages_column_def'] = array(                                     
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'hotelMember_id'=> 'INT(11)',
                                        'hotelRoom_id'  => 'INT(11)',
                                        's_fileName'    => 'VARCHAR(255)',
                                        'm_fileName'    => 'VARCHAR(255)',       
                                        'l_fileName'    => 'VARCHAR(255)', 
                                        's_path'        => 'VARCHAR(255)',
                                        'm_path'        => 'VARCHAR(255)',
                                        'l_path'        => 'VARCHAR(255)',
                                        's_url'         => 'VARCHAR(255)',
                                        'm_url'         => 'VARCHAR(255)',
                                        'l_url'         => 'VARCHAR(255)',
                                        'o_fileName'    => 'VARCHAR(255)',
                                        'o_path'        => 'VARCHAR(255)',
                                        'o_url'         => 'VARCHAR(255)',
                                        'type'          => 'VARCHAR(255)'
    );
    $pntable['hotelbooking_hotelroomimages_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelroomimages_column'], 'hri_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelroomimages_column_def']);
    
    
    ////////////////////////////////////////////
    //table definition HotelBooking_HotelAllotment
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelallotment'] = DBUtil::getLimitedTablename('hotelbooking_hotelallotment');
    $pntable['hotelbooking_hotelallotment_column'] = array(
                                        'id'            => 'ham_id',
                                        'hotelMember_id'=> 'ham_hotelMember_id',
                                        'hotelRoom_id'  => 'ham_hotelroom_id',
                                        'date'          => 'ham_date',
                                        'available'     => 'ham_available'
    );
    $pntable['hotelbooking_hotelallotment_column_def'] = array(                                     
                                        'id'            => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'hotelMember_id'=> 'INT(11)',
                                        'hotelRoom_id'  => 'INT(11)',
                                        'date'          => 'DATE',
                                        'available'     => 'INT(11)'
    );
    $pntable['hotelbooking_hotelallotment_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelallotment_column'], 'ham_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelallotment_column_def']);
    
    
    ////////////////////////////////////////////
    //table definition HotelBooking_Hotelbooking_date
    ////////////////////////////////////////////
    $pntable['hotelbooking_hotelbooking_date'] = DBUtil::getLimitedTablename('hotelbooking_hotelbooking_date');
    $pntable['hotelbooking_hotelbooking_date_column'] = array(
                                        'id'                => 'hbd_id',
                                        'hotelMember_id'    => 'hbd_hotelMember_id',
                                        'date'              => 'hbd_date',
                                        'hotelRate_id'      => 'hbd_hotelrate_id',
                                        'hotelBooking_id'   => 'hbd_hotelbooking_id'
    );
    $pntable['hotelbooking_hotelbooking_date_column_def'] = array(                                     
                                        'id'                => 'INT(11) AUTOINCREMENT PRIMARY',
                                        'hotelMember_id'    => 'INT(11)',
                                        'date'              => 'DATE',
                                        'hotelRate_id'      => 'INT(11)',
                                        'hotelBooking_id'   => 'INT(11)'
    );
    $pntable['hotelbooking_hotelbooking_date_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['hotelbooking_hotelbooking_date_column'], 'hbd_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['hotelbooking_hotelbooking_date_column_def']);
    
    
    
    return $pntable;
}

?>